package com.smoed.common.utilities;

import com.smoed.common.utilities.unitconversions.TimeUnitConversions;

public class StopWatch {

    private long start;
    private long stop;

    public StopWatch() {
    }

    public StopWatch start() {
        start = System.nanoTime();
        return this;
    }

    public StopWatch stop() {
        stop = System.nanoTime();
        return this;
    }

    public long getNanos() {
        return stop-start;
    }

	@Override
	public String toString() {
		return TimeUnitConversions.NANO.getConvenientRepresentation(getNanos());
	}
}
